x86: Retry do_mmu_update() a few times when called on a pte whose type is in flux.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 20 Sep 2010 19:11:43 +0000 (20:11 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 20 Sep 2010 19:11:43 +0000 (20:11 +0100)
commit89acd8b4d60220b35bf97d94fe55a5cba47a5048
tree6c1f386108288ca4cf33a76ae5fb5120e0c20643
parent4276fde7f870feeec65f33e43b2e0cd5ae79b572
x86: Retry do_mmu_update() a few times when called on a pte whose type is in flux.

This can really happen -- all our PV Linux kernels have a race
between vmalloc_sync_all() and pgdir pinning/unpinning. The former is
protected by pgd_lock while the latter by mm->page_table_lock. Hence
they can happen concurrently, and vmalloc_sync_all() can attempt to
set_pmd() on a page directory which is in the process of being
pinned. This can confuse the hypervisor which may see a type change,
and hence fail do_mmu_update(). Until this patch. :-)

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/mm.c